home *** CD-ROM | disk | FTP | other *** search
- Path: mail2news.demon.co.uk!genesis.demon.co.uk
- From: Lawrence Kirby <fred@genesis.demon.co.uk>
- Newsgroups: comp.lang.c
- Subject: Re: Calculation in C: HELP
- Date: Sat, 27 Jan 96 18:38:45 GMT
- Organization: none
- Message-ID: <822767925snz@genesis.demon.co.uk>
- References: <4eddjd$mde@newsbf02.news.aol.com>
- Reply-To: fred@genesis.demon.co.uk
- X-NNTP-Posting-Host: genesis.demon.co.uk
- X-Newsreader: Demon Internet Simple News v1.27
- X-Mail2News-Path: genesis.demon.co.uk
-
- In article <4eddjd$mde@newsbf02.news.aol.com>
- queenhead@aol.com "Queenhead" writes:
-
- >Hi. I am trying to use the following calculation in a program and it is
- >not coming out right:
- >
- >nextyr = rate * currentyr * ( 1 - (currentyr/1000000)
- >
- >Is something wrong with that (in terms of C syntax)? I should be getting
- >234,000 if rate is 2.6 and currentyr is 100,000. My program is not
- >giving me that.
-
- What *is* it giving you?
-
- What are the types of your variables? If currentyr is a long then
- currentyr/1000000 is 0. If currentyr is an int it may not even be able
- to hold 100000.
-
- Please post the actual code you compiled - as it stands what you have here
- won't compile because the parentheses aren't balanced.
-
- --
- -----------------------------------------
- Lawrence Kirby | fred@genesis.demon.co.uk
- Wilts, England | 70734.126@compuserve.com
- -----------------------------------------
-